package net.wangds.data.impl;

import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
import net.wangds.data.ColumnOrientedDataTypeEnum;
import net.wangds.data.DataTypeEnum;
import net.wangds.data.WithIdAndCreatInfo;
import net.wangds.data.ann.ColumnDef;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@MappedSuperclass
public abstract class IdCreate extends WithIdImpl implements WithIdAndCreatInfo<String> {

    private static final long serialVersionUID = 0;
    /**
     * 创建时间.
     */
    @Getter
    @Setter
    @Column(name="ctm")
    @Builder.Default
    @ColumnDef(displayname = "创建时间戳", dataType = DataTypeEnum.Long,
            colDataType = ColumnOrientedDataTypeEnum.Long, memo = "精确到毫秒")
    @ApiModelProperty("创建时间戳")
    private long createTm=System.currentTimeMillis();
}
